<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" isELIgnored="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
    <head>
        <!-- 指定字符集 -->
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>修改用户</title>

        <!-- 1. 导入CSS的全局样式 -->
        <link href="../css/bootstrap.min.css" rel="stylesheet">
        <!-- 2. jQuery导入，建议使用1.9以上的版本 -->
        <script src="../js/jquery-2.1.0.min.js"></script>
        <!-- 3. 导入bootstrap的js文件 -->
        <script src="../js/bootstrap.min.js"></script>
        
    </head>
    <body>
    <div style="text-align: right;color: red;">
        <c:if test="${not empty user}">
            欢迎 ${user.username}
        </c:if>
    </div>
        <div class="container" style="width: 400px;">

        <h3 style="text-align: center;">修改联系人</h3>
        <form action="/contact" method="post">
            <input type="hidden" name="method" value="update">
            <input type="hidden" name="id" value="${contact.id}">
      <div class="form-group">
        <label for="name">姓名：</label>
        <input type="text" class="form-control" id="name" name="name" value="${contact.name}" />
      </div>

      <div class="form-group">
        <label>性别：</label>
          <input type="radio" name="sex" value="男" ${contact.sex=="男"?"checked" : ""} />男
    		<input type="radio" name="sex" value="女" ${contact.sex=="女"?"checked" : ""} />女
      </div>
      
      <div class="form-group">
        <label for="age">年龄：</label>
        <input type="text" class="form-control" id="age"  name="age" value="${contact.age}"/>
      </div>

      <div class="form-group">
        <label for="address">籍贯：</label>
	     <select id="address" name="address" class="form-control" >
	        <option value="广东" ${contact.address=="广东"?"selected" : ""}>广东</option>
	        <option value="广西" ${contact.address=="广西"?"selected" : ""}>广西</option>
	        <option value="湖南" ${contact.address=="湖南"?"selected" : ""}>湖南</option>
        </select>
      </div>
      
      <div class="form-group">
        <label id="qq" for="qq">QQ：</label>
        <input type="text" class="form-control" name="qq" value="${contact.qq}"/>
      </div>

      <div class="form-group">
        <label id="email" for="email">Email：</label>
        <input type="text" class="form-control" name="email" value="${contact.email}"/>
      </div>

         <div class="form-group" style="text-align: center">
			<input class="btn btn-primary" type="submit" value="提交" />
			<input class="btn btn-default" type="reset" value="重置" />
			<input class="btn btn-default" type="button" value="返回"/>
         </div>
        </form>
        </div>
    </body>
</html>